#/usr/bin

mkdir nvidia-driver
cd nvidia-driver

# 下载驱动并启动安装
if [ ! -f "NVIDIA-Linux-x86_64-470.63.01.run" ]; then
    wget https://cn.download.nvidia.cn/XFree86/Linux-x86_64/470.63.01/NVIDIA-Linux-x86_64-470.63.01.run
fi
chmod a+x NVIDIA-Linux-x86_64-470.63.01.run
sudo ./NVIDIA-Linux-x86_64-470.63.01.run

# 安装完成，清理垃圾
sed -i '/bash ~\/install-nvidia-driver.sh/d' ~/.bashrc
cd ..
rm -r nvidia-driver
